package com.ailink.design.principle.liskov;

/**
 * Created by Administrator on 2018/9/19
 */
public class Test {

    public static void resize(Rectangle rectangle) {
        while (rectangle.getWidth() <= rectangle.getLength()) {
            rectangle.setWidth(rectangle.getWidth() + 1);
            System.out.println("length=" + rectangle.getLength());
            System.out.println("width=" + rectangle.getWidth());
        }

    }

    public static void main(String[] args) {
        Rectangle rectangle = new Rectangle();
        rectangle.setLength(100);
        rectangle.setWidth(100);
        resize(rectangle);

        Square square = new Square();
        square.setSide(16);
        resize(square);
    }
}
